package com.life.ai.server.framework.desensitize;


import lombok.AllArgsConstructor;

import java.util.function.Function;

/**
 * 脱敏类型
 * DesensitizeType
 *
 * @author kylewka
 * @since 2023/11/22
 */
@AllArgsConstructor
public enum DesensitizeStrategy {
    //自定义
    CUSTOMER(s -> s),
    //身份证号
    ID_CARD(DesensitizedUtils::idCardNum),
    //座机号
    FIXED_PHONE(DesensitizedUtils::fixedPhone),
    //手机号
    MOBILE_PHONE(DesensitizedUtils::mobilePhone),
    //地址
    ADDRESS(DesensitizedUtils::address),
    //电子邮件
    EMAIL(DesensitizedUtils::email),
    //密码
    PASSWORD(DesensitizedUtils::password),
    //中国大陆车牌，包含普通车辆、新能源车辆
    CAR_LICENSE(DesensitizedUtils::carLicense),
    //银行卡
    BANK_CARD(DesensitizedUtils::bankCard),
    // IPV4
    IPV4(DesensitizedUtils::ipv4),
    // IPV6
    IPV6(DesensitizedUtils::ipv6),
    ;

    private final Function<String, String> desensitize;

    public Function<String, String> desensitize() {
        return desensitize;
    }
}
